package com.obggtc.picture.dto.ai;

import lombok.Data;

/**
 * AI聊天响应DTO
 * 
 * @author system
 * @date 2025/09/10
 */
@Data
public class AiChatResponse {
    
    /**
     * AI回复的内容
     */
    private String content;
    
    /**
     * 会话ID
     */
    private String sessionId;
    
    /**
     * 消耗的token数量
     */
    private Integer tokensUsed;
    
    /**
     * 响应状态码
     */
    private Integer code;
    
    /**
     * 响应消息
     */
    private String message;
    
    /**
     * 请求ID（用于问题追踪）
     */
    private String requestId;
    
    /**
     * 响应时间戳
     */
    private Long timestamp;
    
    /**
     * 构造成功响应
     */
    public static AiChatResponse success(String content, String sessionId) {
        AiChatResponse response = new AiChatResponse();
        response.setContent(content);
        response.setSessionId(sessionId);
        response.setCode(200);
        response.setMessage("成功");
        response.setTimestamp(System.currentTimeMillis());
        return response;
    }
    
    /**
     * 构造失败响应
     */
    public static AiChatResponse error(String message) {
        AiChatResponse response = new AiChatResponse();
        response.setCode(500);
        response.setMessage(message);
        response.setTimestamp(System.currentTimeMillis());
        return response;
    }
}
